import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';

@Injectable({
  providedIn: 'root'
})
export class LoveMakeupAwardPrizesService {

  serviceUrls: any = {
    queryWinPrizeListUrl: '/recycleActivityUserRecord/list', // 查询中奖List
    updateWinPrizeInfoUrl: '/recycleActivityUserRecord/update', // 修改收款信息
    exportWinPrizeUrl: '/recycleActivityUserRecord/findExcel', // 导出中奖信息
    grantWinPrizeUrl: '/recycleActivityUserRecord/grantPrize', // 发放奖品
    grantWinPrizeAttriActUrl: '/recycleActivityUserRecord/activityList', // 查询归属活动list
  };

  constructor(public httpClient: HttpClient) { }
  
  // 查询中奖List
  queryWinPrizeData(params: any) {
    return this.httpClient.post(this.serviceUrls.queryWinPrizeListUrl, params).toPromise();
  }

  // 修改收款信息
  updateWinPrizeInfoData(params: any) {
    return this.httpClient.post(this.serviceUrls.updateWinPrizeInfoUrl, params).toPromise();
  }

  // 导出中奖信息
  exportWinPrizeData(params: any) {
    return this.httpClient.get(this.serviceUrls.exportWinPrizeUrl, { params, responseType: 'blob' }).toPromise();
  }
  
  // 发放奖品
  grantWinPrizeData(params: any) {
    return this.httpClient.post(this.serviceUrls.grantWinPrizeUrl, params).toPromise();
  }

  // 查询归属活动list
  grantWinPrizeAttriActData(params: any) {
    return this.httpClient.post(this.serviceUrls.grantWinPrizeAttriActUrl, params).toPromise();
  }
}



